import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";

var _dec, _class;

import React from 'react';
import { Button, Form, Modal, Spin } from 'antd';
import intl from 'utils/intl';
var JobErrorModal = (_dec = Form.create({
  fieldNameProp: null
}), _dec(_class = /*#__PURE__*/function (_React$Component) {
  _inherits(JobErrorModal, _React$Component);

  var _super = _createSuper(JobErrorModal);

  function JobErrorModal() {
    _classCallCheck(this, JobErrorModal);

    return _super.apply(this, arguments);
  }

  _createClass(JobErrorModal, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          onOk = _this$props.onOk,
          onCancel = _this$props.onCancel,
          jobErrorDetail = _this$props.jobErrorDetail,
          modalVisible = _this$props.modalVisible,
          _this$props$initLoadi = _this$props.initLoading,
          initLoading = _this$props$initLoadi === void 0 ? false : _this$props$initLoadi;
      return /*#__PURE__*/React.createElement(Modal, {
        title: intl.get('csdr.jobLog.model.jobLog.errorDetail').d('错误详情'),
        visible: modalVisible,
        wrapClassName: "ant-modal-sidebar-right",
        transitionName: "move-right",
        width: 620,
        destroyOnClose: true,
        closable: false,
        onCancel: onCancel,
        footer: /*#__PURE__*/React.createElement(Button, {
          type: "primary",
          onClick: onOk
        }, intl.get('cpaas.common.button.ok').d('确定'))
      }, /*#__PURE__*/React.createElement(Spin, {
        spinning: initLoading
      }, !initLoading && /*#__PURE__*/React.createElement("p", {
        dangerouslySetInnerHTML: {
          __html: jobErrorDetail
        }
      })));
    }
  }]);

  return JobErrorModal;
}(React.Component)) || _class);
export { JobErrorModal as default };